package com.lin.sunnyweather.utils

import org.junit.Assert.assertEquals
import org.junit.Test

class VersionUtilsTest {
    @Test
    fun isNew_isCorrect() {
        assertEquals(VersionUtils.isNew("", ""), false)
        assertEquals(VersionUtils.isNew("1.0.0", ""), false)
        assertEquals(VersionUtils.isNew("1.0.0", "2"), true)
        assertEquals(VersionUtils.isNew("2", "1.0.0"), false)
        assertEquals(VersionUtils.isNew("1.0.0", "1.1"), true)
        assertEquals(VersionUtils.isNew("1.0.0", "1.0.1"), true)
        assertEquals(VersionUtils.isNew("1.0.0", "1.0.0.0"), false)
        assertEquals(VersionUtils.isNew("1.0.0", "01.0.1"), true)
        assertEquals(VersionUtils.isNew("a", "b"), true)
    }
}